#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int x = 0;
	scanf("%d", &x);
	if (x % 2 == 0 && x > 4 && x <= 12)
		printf("1 ");
	else
		printf("0 ");
	if (x % 2 == 0)
		printf("1 ");
	else if (x > 4 && x <= 12)
		printf("1 ");
	else
		printf("0 ");
	if ((x % 2 == 0) && (x > 12 || x <= 4))
		printf("1 ");
	else if ((x % 2 != 0) && (x <= 12 && x > 4))
		printf("1 ");
	else
		printf("0 ");
	if (x % 2 == 0)
		printf("0 ");
	else if (4 < x && x <= 12)
		printf("0 ");
	else
		printf("1 ");
	return 0;
}
